package iterator;

import java.io.IOException;

import global.AttrType;
import global.BPOrder;
import heap.Tuple;

public class BPSort {
	
//	BPOrder sort_order;
//	BPIterator input_itr;
//	int SortNodeIDPos;
//	int n_pages;
	Sort sort;
	public BPSort ( AttrType[] attrType, short len, short[] strSize,  BPIterator input_itr, BPOrder sort_order,
			int sortNodeIDPos,
			int n_pages) throws SortException, IOException{
		if(sortNodeIDPos == -1)
			sort = new Sort(attrType, len, strSize, input_itr, len, sort_order, 4, n_pages);
		else
			sort = new Sort(attrType, len, strSize, input_itr, sortNodeIDPos, sort_order, 100, n_pages);
	}
	
	public Tuple get_next() throws SortException, UnknowAttrType, LowMemException, JoinsException, IOException, Exception
	{
		return sort.get_next();
		
	}
	
	public void close() throws SortException, IOException
	{
		sort.close();
	}

}
